﻿using System;
using System.Collections.Generic;

namespace Hsenl {
    public class QueueComponent<T> : Queue<T>, IDisposable {
        public static QueueComponent<T> Rent() {
            return (QueueComponent<T>)ObjectPool.Rent(typeof(QueueComponent<T>));
        }

        public void Dispose() {
            this.Clear();
            if (this.Count > 2048)
                return;
            ObjectPool.Return(this);
        }
    }
}